<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>主题发表</title>
    <script type="text/javascript" src="Content/script/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="Content/script/jquery.validate.js"></script>
    <script type="text/javascript">
        $(function(){
           $("#form").validate({
               rules:{
                   title:{
                       required:true
                   },
                   content:{
                       required:true
                   }
               },
               messages:{
                   title:{
                       required:"请输入标题"
                   },
                   content:{
                       required:"请输入内容"
                   }
               }
           });

        });
    </script>
    <style>
        label.error{color:red}
    </style>
    <!-- Bootstrap -->
    <link href="Content/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <%@ include file="../shared/header.jsp"%>
    <div id="path">
        <ol class="breadcrumb">
            <li><a href="index.htm">首页</a></li>
            <li><a href="register.html">发表主题</a></li>
        </ol>
    </div>
    <div id="content">
        <form class="form-horizontal" method="post" action="KeynoteServlet" id="form">
            <div class="form-group">
                <label class="col-sm-2 control-label">标题</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="title" placeholder="标题">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">板块</label>
                <div class="col-sm-8">
                    <!--<input type="password" class="form-control" id="inputPassword3" placeholder="Password">-->
                    <select class="form-control" name="forum">
                        <option value="0">--请选择板块--</option>
                        <c:forEach items="${forum }" var="f">
                            <option value="${f.id }">${f.name }</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">内容</label>
                <div class="col-sm-8">
                    <textarea class="form-control" name="content" rows=4" placeholder="内容"></textarea>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-default">发表</button>
                </div>
            </div>
        </form>
    </div>
    <%@ include file="../shared/footer.jsp"%>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
 <script src="Content/bootstrap/js/bootstrap.min.js"></script> 
</body>
</html>